<?php

print '<h1>Testing DB Connection</h1>';
print '<h2>MySQL Jan 11 259</h2>';

require_once "lib/class.morphini.php";

$Morph = new MorphIni();
$dbhost = $Morph->db_hostname;
$dbport = $Morph->db_port;
$dbtype = $Morph->db_type;
$dbname = $Morph->db_name;
$dbuser = $Morph->db_username;
$dbpass = $Morph->db_password;
$dbconn = "host=$dbhost port=$dbport dbname=$dbname user=$dbuser password=$dbpass";

print "<pre>";
#print "$dbconn\n";
$link = mysql_connect($dbhost .':'. $dbport, $dbuser, $dbpass);
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
echo "Connected successfully\n";
// make foo the current db
$db_selected = mysql_select_db($dbname, $link);
if (!$db_selected) {
    die ('Can\'t use foo : ' . mysql_error());
}

mysql_close($link);

print "</pre>";